<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/include.inc.jsp" %>
<!DOCTYPE html>

<html>
<head>
    <%@include file="/WEB-INF/views/layout/base.ref.jsp" %>
</head>
<body>
<%@include file="/WEB-INF/views/login/home/toolbar.jsp" %>
<div class="mtcontent">
    <div class="mtheader">
        <shiro:hasPermission name="securityAccount:add">
            <a class="mtbtn one" href="#"
               onclick="hrefNew_OnClick('${ctx}/security/securityaccount/edit?id=-1');"><span><i
                    class="mtfa mt-add"></i>添加</span></a>
        </shiro:hasPermission>
        <shiro:hasPermission name="securityAccount:del">
            <a class="mtbtn two" href="#"
               onclick="bootstrapDel_OnClick('${ctx}/security/securityaccount/del','checkboxid')"
               title="确定要删除吗?"> <span><i class="mtfa mt-del"></i>删除</span>
            </a>
        </shiro:hasPermission>
    </div>
    <div class="mtbody">
        <div class="space-4"></div>
        <form method="post" id="pagerForm" action="${ctx}/security/securityaccount/list?menukey=${menukey}">
            <input type="hidden" name="ifSession" value="1"/>
            <div class="mtrow">
                <div class="mtcolall">
                    <label class="mtlabel-auto">账号：</label> <input type="text" class="mtinput" name="arg"
                                                                   value="${vo.arg}"/> <a
                        class="mtbtn search marginleft" href="#" onclick="queryClick('pagerForm')"><i
                        class="mtfa mt-search"></i><span>查询</span></a>
                    <a class="mtbtn export marginleft" href="#" onclick="queryClick('pagerForm')"><i
                            class="mtfa mt-export"></i><span>导出</span></a>
                </div>
            </div>
        </form>

        <div class="space-4"></div>
        <table id="grid">
        </table>
    </div>
</div>
</body>
</html>
<script type="text/javascript">
    $(function () {
        var cols = [
            {
                title: '选择',
                field: 'check',
                checkbox: true,
                align: 'center',
                valign: 'middle'
            },
            <shiro:hasPermission name="securityAccount:edit">
            {
                title: '操作',
                field: 'id',
                checkbox: false,
                align: 'center',
                valign: 'middle',
                width: 80,
                formatter: function (value, row, index) {
                    return '<a href="#" onclick="hrefEdit_OnClick(\'${ctx}/security/securityaccount/edit\',\'' + value + '\')">修改</a>';
                }
            },
            </shiro:hasPermission>
            {
                title: '账号',
                field: 'account',
                align: 'center',
                valign: 'middle',
                sortable: true
            }, {
                title: '排序',
                field: 'showOrder',
                align: 'center',
                valign: 'middle',
                sortable: true
            },
            <shiro:hasPermission name="securityAccount:edit">
            {
                title: '初始化',
                field: 'id',
                checkbox: false,
                align: 'center',
                valign: 'middle',
                width: 80,
                formatter: function (value, row, index) {
                    return '<a href="#" onclick="ajaxPost(\'${ctx}/security/securityaccount/init\',{id:\'' + value + '\'}, btnDelAjaxCallback, btnErrorAjaxCallback)">初始化</a>';
                }
            },
            </shiro:hasPermission>];
        var data = JSON.parse('${securityAccountList}');
        meeting.grid("#grid", cols, data);
    });
</script>
